import type { RouteRecordRaw } from 'vue-router'
import { PageEnum } from '@/utils/enums/pageEnums'
import Layout from '@/layout/index.vue'
import { markRaw } from 'vue'
// 使用markRaw包装Layout组件，防止被转为响应式对象
export const LAYOUT = markRaw(Layout)

export const INDEX_ROUTE_NAME = 'Index'
export const constantRoutes: RouteRecordRaw[] = [

    {
        path: PageEnum.LOGIN,
        component: () => import('@/views/system/account/login.vue'),
        name: 'Login',
        meta: {
            title: '登录',
            hidden: true
        }
    },
    {
        path: PageEnum.HOME,
        component: () => LAYOUT,
        name: 'Home',
        meta: {
            title: '首页',
        },
        children: [
            {
                path: '/system/account/:id',
                component: () => import('@/views/system/account/index.vue'),
                name: 'Account',
                meta: {
                    title: '账号管理',
                    select:'/adminapi/permission/admin'
                }
            },{
                path: '/system/test/vueflow',
                component: () => import('@/views/system/test/vueflow.vue'),
                name: 'VueFlow',
                meta: {
                    title: 'VueFlow',
                }
            }
        ]
    }
];

export const INDEX_ROUTE: RouteRecordRaw = {
    path: PageEnum.HOME,
    component: markRaw(Layout),
    name: INDEX_ROUTE_NAME
}
